<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //法一：
        /*let set= new Set([1,2,3,4]);
        let result=Array.from(set);
        console.log(result);*/
        //法二：
        let set= new Set([1,2,3,4]);
        let result=[];
        // set.forEach(item=>{
        //     result.push(item);
        // })
        // console.log(result);
        //法三：
        for(var key of set){
            result.push(key)
        }
        console.log(result);
        

    </script>
</head>
<body>
    
</body>
</html>